package homework2;

public class Trapezoid extends Shape{
	private double top;
	private double bottom;
	private double height;

	public Trapezoid(String type) {
		super(type);
	}
	public Trapezoid(double top,double bottom,double height) {
		super("梯形");
		this.top=top;
		this.bottom=bottom;
		this.height=height;
	}
	public void calculate() {
		super.calculate();
		this.area=(top+bottom)*height/2;
	}
	public void show() {
		System.out.println("梯形的上底为：" + this.top+"下底为："+this.bottom+"高为："+this.height );
		super.show();
	}
	



	
}
